CREATE EXTERNAL TABLE  spmi_dwd.dwd_spmi_union_bill_dt (
   `id` bigint COMMENT '主键ID',
   `waybill_no` string COMMENT '运单编号',
   `settle_network_name` string COMMENT '结算网点名称',
   `settle_network_code` string COMMENT '结算网点CODE',
   `settle_network_id` bigint COMMENT '结算网点ID',
   `financial_center_name` string COMMENT '所属财务中心',
   `financial_center_code` string COMMENT '所属财务CODE',
   `financial_center_id` bigint COMMENT '所属财务中心ID',
   `waybill_num` bigint COMMENT '票数',
   `waybill_piece` bigint COMMENT '件数',
   `cost_weight` double COMMENT '计费重量',
   `settle_weight` double COMMENT '结算重量',
   `transfer_cost` double COMMENT '中转费',
   `operation_cost` double COMMENT '操作费',
   `piece_fee_cost` double COMMENT '派件费',
   `distribu_depart_cost` double COMMENT '集散出港支线费',
   `distribu_opera_cost` double COMMENT '集散操作费',
   `is_package_cost` smallint COMMENT '包计费标识 1是 2否',
   `product_type_id` bigint COMMENT '产品类型ID',
   `product_type_name` string COMMENT '产品类型名称',
   `goods_type_id` bigint COMMENT '物品类型ID',
   `goods_type_name` string COMMENT '物品类型名称',
   `transport_type_id` bigint COMMENT '运输方式ID',
   `transport_type_name` string COMMENT '运输方式名称',
   `customer_code` string COMMENT '寄件客户编码',
   `customer_name` string COMMENT '寄件客户名称',
   `begin_id` bigint COMMENT '始发地ID',
   `begin_name` string COMMENT '始发地名称',
   `sender_province_id` bigint COMMENT '寄件省份ID',
   `sender_province_name` string COMMENT '寄件省份名称',
   `destination_id` bigint COMMENT '目的地ID',
   `destination_name` string COMMENT '目的地名称',
   `receiver_province_id` bigint COMMENT '收件省份ID',
   `receiver_province_name` string COMMENT '收件省份名称',
   `waybill_time` timestamp COMMENT '运单录入时间',
   `sign_time` timestamp COMMENT '签收时间',
   `send_financial_center_id` bigint COMMENT '寄件财务中心ID',
   `send_financial_center_name` string COMMENT '寄件财务中心名称',
   `send_financial_center_code` string COMMENT '寄件财务中心编码',
   `send_network_id` bigint COMMENT '寄件财务中心ID',
   `send_network_code` string COMMENT '寄件网点编码',
   `send_network_name` string COMMENT '寄件网点名称',
   `sign_financial_center_id` bigint COMMENT '签收财务中心ID',
   `sign_financial_center_code` string COMMENT '签收财务中心编码',
   `sign_financial_center_name` string COMMENT '签收财务中心名称',
   `sign_network_id` bigint COMMENT '签收网点ID',
   `sign_network_code` string COMMENT '签收网点编码',
   `sign_network_name` string COMMENT '签收网点名称',
   `operation_network_code` string COMMENT '操作网点CODE',
   `operation_network_name` string COMMENT '操作网点名称',
   `operation_financial_center_code` string COMMENT '操作财务中心CODE',
   `operation_financial_center_name` string COMMENT '操作财务中心名称',
   `is_sign` smallint COMMENT '签收标识 1是2否',
   `is_bad_piece` smallint COMMENT '问题件标识 1是2否',
   `is_refund` smallint COMMENT '退件标识1是2否',
   `remarks` string COMMENT '备注',
   `version` bigint COMMENT '版本号',
   `bill_generation_date` string COMMENT '账单产生日期',
   `create_time` timestamp COMMENT '创建时间',
   `update_time` timestamp COMMENT '更新时间',
   `last_update_time_sync` timestamp COMMENT '同步ES更新时间',
   `trace_id` string COMMENT 'TRACEID',
   `customer_fee` double COMMENT '客户运费',
   `distribu_version` bigint COMMENT '集散费用版本号',
   `waybill_weight` double COMMENT '入参重量',
   `package_charge_weight_source` bigint COMMENT '重量来源',
   `center_packge_cost` double COMMENT '中心代建包费',
   `distribu_packge_cost` double COMMENT '集散代建包费',
   `is_bubble` smallint COMMENT '计泡标识 1 是 2 否',
   `retrieve_status` smallint COMMENT '回收标识 1是 2否',
   `settle_franchisee_name` string COMMENT '结算加盟商名称',
   `settle_franchisee_code` string COMMENT '结算加盟商CODE',
   `settle_franchisee_id` bigint COMMENT '结算加盟商ID',
   `is_equals_send_piece` smallint COMMENT '是否自收自派（1是2否）')
 COMMENT 'dwd层清洗表-网点中心综合账单'
 PARTITIONED BY (
   `dt` string COMMENT '账单产生日期 (yyyy-MM-dd)')
 ROW FORMAT SERDE
   'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
 STORED AS INPUTFORMAT
   'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
 OUTPUTFORMAT
   'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
 LOCATION
   '/dw/hive/spmi_dwd.db/external/dwd_spmi_union_bill_dt'  ;